home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 2
/
Nebula Two.iso
/
SourceCode
/
Palettes
/
BarChart
/
ChartOfMatrix.h
< prev
next >
Wrap
Text File
|
1992-12-20
|
5KB
|
172 lines
/*
* BarChart, A simple multi source loadable class.
*
* Written by: Joe Freeman 7/92
*
* HSB color sweep stolen from some of Randy Nelson's code
* should use NXEqualColor() for duplicates
*
*/
/* bar spacing:Each plot is a width of 2N and each gap is a width of 1N
* The total width is m*(2N+N) + N = 3mN+N = where m is number of bars
* Thus N = width / (3m+1)
*/
/* Generated by Interface Builder */
#import <appkit/appkit.h>
#import <dbkit/dbkit.h>
typedef enum _graphType {
DRAW_H_BAR = 0,
DRAW_V_BAR = 1,
DRAW_H_LINE = 2,
DRAW_V_LINE = 3 /* not impl */
} graphType;
@interface ChartOfMatrix:View
{
id dataSrc; /* only connect in nib if is really matrix */
id minField;
id maxField;
id meanField;
float minSheetSet, maxSheetSet;/* min and max size if not auto */
float vMargin,hMargin;/* size of top/bottom, right/left margins */
struct _COM_Flags {
BOOL autoScale:1; /* set vertical on fly or from xxxSheetSet */
BOOL randomBarColors:1;/* random color for the bars */
BOOL drawFrame:1; /* the black line around the plot */
unsigned drawType:3; /* bars, h, v, line */
unsigned dummy:10;
} COM_Flags;
NXColor backgroundColor;
NXColor highlightColor;
unsigned int highlightIndex; /* currently selected row */
int numPrototypes; /* number of prototype bars/ points disp IB */
int borderType; /* should we bezel */
id mrExpression,mrFetchGroup; /* if getting fed from recordList */
}
- initFrame:(NXRect *)r;
- awake;
/*============================================================
* color dragging support
*============================================================*/
- (NXDragOperation)draggingEntered:(id <NXDraggingInfo>)sender;
- (BOOL)performDragOperation:(id <NXDraggingInfo>)sender;
/*============================================================
* instance set / query methods
*============================================================*/
- setGraphType:(int)drawCode;
- (int)graphType;
/* */
- takeRandomColorStateFrom:sender;
- setRandomBarColorEnabled:(BOOL)flag;
- (BOOL)isRandomBarColorEnabled;
- takeBackgroundColorFrom:sender;
- setBackgroundColor:(NXColor)aColor;
- (NXColor)backgroundColor;
- takeHighlightColorFrom:sender;
- setHighlightColor:(NXColor)aColor;
- (NXColor)highlightColor;
/* set and query the size for the margins (in points) */
- takeHMarginFrom:sender;
- takeVMarginFrom:sender;
- (float)hMargin;
- (float)vMargin;
/* fancy controls */
- takeFrameStateFrom:sender;
- (BOOL)frameState;
- takeNumProtosFrom:sender;
- (int)numProtos;
- takeBorderTypeFrom:sender; /* what type of bezel gets sender's tag*/
- (int)borderType;
- takeAutoScaleStateFrom:sender;
- setAutoScale:(BOOL)flag;
- (BOOL)autoScale;
/* when autoscale is off, set the min and max for the sheet */
- takeMinValueFrom:sender;
- takeMaxValueFrom:sender;
- (double)minValue;
- (double)maxValue;
/*============================================================
* pasteboard
*============================================================*/
- copy:sender;
/*============================================================
* do real work
*============================================================*/
- (int)numLocations;
- (float)valueOfLocation:(int)n;
- calcRect:(NXRect *)r
ofBar:(int)n
insideRect:(NXRect *)boundingRect
usingMin:(float)minSheetVal;
/*============================================================
* target action loading
*============================================================*/
- plotFromMatrix:sender;
/* we get this when DBModule fetches new batch of values */
/*============================================================
* dbKit feed
*============================================================*/
- associationContentsDidChange:association;
/* we get this when values are updated via UI */
- association:association setValue:(DBValue *)value;
/* we get this when the selection changes */
- associationSelectionDidChange:association;
/* we get this when a row is deleted */
- associationCurrentRecordDidDelete:association;
/*============================================================
* do a selection with the mouse
*============================================================*/
- mouseDown:(NXEvent *)theEvent;
/*============================================================
* archiving for the inspector
*============================================================*/
- read:(NXTypedStream *)stream;
- write:(NXTypedStream *)stream;
/*============================================================
* rendering
*============================================================*/
- calcMin:(float *)rMin andMax:(float *)rMax andMean:(float *)rMean;
- renderVLines:(NXRect *)r min:(float )minSheetVal max:(float )maxSheetVal;
- renderBars:(NXRect *)r min:(float )minSheetVal max:(float )maxSheetVal;
/*============================================================
* rendering
*============================================================*/
- drawSelf:(NXRect *)r :(int)c;
@end